Sink (computing)
In computing, a sink, or data sink generally refers to the destination of data flow.
The word sink has multiple uses in computing. In software engineering, an event sink is a class or function that receives events from another object or function, while a sink can also refer to a node of a directed acyclic graph with no additional nodes leading out from it, among other uses.
In software engineering
[edit]An event sink is a class or function designed to receive incoming events from another object or function. This is commonly implemented in C++ as callbacks. Other object-oriented languages, such as Java and C#, have built-in support for sinks by allowing events to be fired to delegate functions.
Due to lack of formal definition, a sink is often misconstrued with a gateway, which is a similar construct but the latter is usually either an end-point or allows bi-direction communication between dissimilar systems, as opposed to just an event input point [citation needed]. This is often seen in C++ and hardware-related programming [citation needed], thus the choice of nomenclature by a developer usually depends on whether the agent acting on a sink is a producer or consumer of the sink content.
In graph theory
[edit]In a Directed acyclic graph, a source node is a node (also known as a vertex) with no incoming connections from other nodes, while a sink node is a node without outgoing connections.[1]
Directed acyclic graphs are used in instruction scheduling, neural networks and data compression.
In stream processing
[edit]In several computer programs employing streams, such as GStreamer, PulseAudio, or PipeWire, a sink is the starting point of a pipeline which consumes a stream of data, while a source is the end point which emits a stream a data (often after performing some processing function on the data).[2]
An example is an audio pipeline in the PulseAudio sound system. An input device such as a microphone is an audio device which will send data to a sink for consumption. The audio signal will then be made available as an audio source, which may have undergone audio processing, such as volume adjustment. Typically, it will also pass through other stages, such as audio mixing. In this way the volume adjustment processing receives audio samples via its sink, emits them from its source, which is then connected to a mixer sink, which mixes audio, ultimately emitting the processed audio from its source. Referred to as an output source in PulseAudio. The configuration and connection of these pipelines can be complex and dynamic. [3]
The terms sink and source may be confusing, but they specifically refer to the point of entry (source) and exit (sink) in systems. The terminology is exactly analogous to that used in other domains, such as electrical engineering. [4]
Other uses
[edit]The word sink has been used for both input and output in the industry.[citation needed] Mobile sink is proposed to save sensor energy for multihop communication in transferring data to a base station (sink) in wireless sensor networks.
See also
[edit]References
[edit]- ^ "Wolfram Mathworld: Digraph Sink".
- ^ "Elements". GStreamer Documentation.
- ^ "About – PulseAudio". PulseAudio.
- ^ "Current Sourcing and Sinking".